from vod_frame import KittiLocations
from vod_frame import FrameDataLoader
kitti_locations = KittiLocations(root_dir="example_set",
output_dir="example_output")
frame_data = FrameDataLoader(kitti_locations=kitti_locations,
frame_number="01201")
The Visualization2D class allows the projection of the lidar, radar data, and the 3D-boxes of the annotation to the camera picture. The example below shows the instantiation of the class, and applies the generate_frame_picture() to plot the picture.
from vod_visualization import Visualization2D
vis2d = Visualization2D(frame_data)
vis2d.generate_frame_picture()
By changing the arguments of the generate_frame_picture() method, plotting lidar points is also possible.
vis2d.generate_frame_picture(is_lidar_pcl_plot=True)
Similar to Lidar, provided is_radar_pcl_plot=True argument, the radar pcl can be also plotted over the picture.
vis2d.generate_frame_picture(is_radar_pcl_plot=True)
Similar to point-cloud data, the 3D bounding boxes can be also plotted over the picture.
vis2d.generate_frame_picture(is_gt_plot=True)
Plotting the point-clouds and the annotations in a single plot is also possible. It is also possible to set filters for distance, which limits the number of plotted instances. Using the save_figure argument, it is possible to save the image to a file as well.
vis2d.generate_frame_picture(is_lidar_pcl_plot=True,
is_radar_pcl_plot=True,
is_gt_plot=True,
min_distance_threshold=5,
max_distance_threshold=20,
save_figure=True)
import os
os.system('jupyter nbconvert --to html 3_2d_visualization.ipynb')
0